package com.fortressweb.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.demoweb.model.dao.MemberDao;
import com.demoweb.model.dto.Membership;

@WebServlet("/fortress/fortressAbout.nhn")
public class FortressAboutServlet extends HttpServlet {
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
	
		//로그인 상태가 아닌 경우 로그인 페이지로 이동
		if (req.getSession().getAttribute("loginuser") == null) {
			resp.sendRedirect(
				"/demoweb/fortress/fortressLoginForm.nhn?" + 
				"returnuri=" + req.getRequestURI());
			return;
		}
		
		RequestDispatcher dispatcher = req
				.getRequestDispatcher("/WEB-INF/views/fortress/fortressabout.jsp");

		dispatcher.forward(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doGet(req,resp);
	}
}
